package io.seata.sample.repository;

import io.seata.sample.entity.Storage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lock;

import javax.persistence.LockModeType;

/**
 * Description：
 *
 * @author fangliangsheng
 * @date 2019-04-04
 */
public interface StorageDAO extends JpaRepository<Storage, String> {
    
    @Lock(value = LockModeType.PESSIMISTIC_WRITE)
    Storage findByCommodityCode(String commodityCode);
    
}
